package com.powernode;

/**
 * description 暂无描述
 * author smile
 * time 2023/3/13 21:00
 */
public class Circle {
    double r;

    public Circle(double r){
        this.r=r;
    }

   public   void getArea(){
     double area=3.14*r*r;
       System.out.println("半径为"+r+"\n"+"面积为："+area);
   }
   public  void getPerimeter(){
    double perimeter=2*3.14*r;
       System.out.println("周长为：" + perimeter);
   }

    public static void main(String[] args) {
        Circle a=new Circle(1.2);
        a.getArea();
        a.getPerimeter();

    }
}
